<% Dim Action,username,bbsID,ID,PageInfo CheckString "36" username=MNBoard.MyName Head() Action=request.querystring("Action") Select Case Action Case "Submit" Submit() Case "See" See() Case "Del" Del() Case "TBInfo" TBInfo() Case "Giveback" Giveback() Case "DelAll" DelAll() Case Else Recycle() End Select Footer() Set MNBoard =Nothing Function GetPageInfo(PTable,PFieldslist,PCondiction,POrderlist,PPrimaryKey,PSize,PCookiesName,Purl) Dim P Set P = New Cls_PageView P.strTableName =PTable P.strFieldsList =PFieldslist P.strCondiction =PCondiction P.strOrderList = POrderlist P.strPrimaryKey = PPrimaryKey P.intPageSize = PSize P.intPageNow = Request("page") P.strCookiesName = PCookiesName P.strPageUrl = PUrl P.InitClass GetPageInfo = P.arrRecordInfo PageInfo = P.strPageInfo Set P = nothing End Function Sub Recycle() Response.Write"
"&_ "
回收站
" Dim arr_Rs,i Dim Temp,BbsID Arr_rs=GetPageInfo("[i_Topic]","TopicID,SqlTableID,Face,Caption,Name,LastTime,BoardID,ReplyNum","IsDel=1","TopicID desc","TopicID",20,"Recycle"&MNBoard.TB,"?action=Recycle") If IsArray(Arr_Rs) Then Response.Write"" For i = 0 to UBound(Arr_Rs, 2) Set Rs=MNBoard.Execute("Select BbsID From[i_Bbs"&Arr_Rs(1,i)&"] Where TopicID="&Arr_Rs(0,i)&" and BoardID="&Arr_Rs(6,i)) If Not Rs.Eof Then BbsID=Rs(0) Rs.Close Response.Write"" Response.Write""&_ ""&_ ""&_ "" Next Response.Write"
选择帖子作者回复最后时间
"&MNBoard.Fun.StrLeft(Arr_Rs(3,i),35)&""&Arr_Rs(4,i)&""&Arr_Rs(7,i)&""&Arr_Rs(5,i)&"
全选 
"&PageInfo&"
" Else Response.Write"

 没有发现删除的主题帖
 
" End If Response.Write"
" End Sub Sub TBInfo() Response.Write"
"&_ "
回收站
"&IconD&"清空回收站
列出全部主题】"&TBList(MNBoard.TB)&"
" Dim intPageNow,arr_Rs,i,Pages,Conut,page,strPageInfo Dim Temp Arr_rs=GetPageInfo("[i_BBS"&MNBoard.TB&"]","BbsID,TopicID,Face,Caption,Name,LastTime,ReplyTopicID,BoardID","IsDel=1","BbsID desc","BbsID",20,"Recycle"&MNBoard.TB,"?action=TBInfo") If IsArray(Arr_Rs) Then Response.Write"" For i = 0 to UBound(Arr_Rs, 2) Response.Write"" Response.Write""&_ ""&_ ""&_ "" Next Response.Write"
选择帖子作者最后时间
"&MNBoard.Fun.StrLeft(Arr_Rs(3,i),25)&""&Arr_Rs(4,i)&""&Arr_Rs(5,i)&"
" Response.Write"
全选 
"&PageInfo&"
" Else Response.Write"

 这个数据表中没有发现被删除的帖子
 
" End If Response.Write"
" End Sub Sub Del() Dim BbsID,TopicID BbsID=Request.querystring("BbsID") TopicID=request.querystring("TopicID") If TopicID=0 then MNBoard.Execute("Delete From [i_Bbs"&MNBoard.TB&"] where IsDel=True And BbsID="&BbsID) MNBoard.Execute("Delete From [i_Appraise] where BbsID="&BbsID&" And TopicID="&TopicID) Suc"","成功删除了这个回复帖!","?" Else MNBoard.Execute("Delete From [i_Topic] where IsDel=True And TopicID="&TopicID) MNBoard.Execute("Delete From [i_TopicVote] where TopicID="&TopicID) MNBoard.Execute("Delete From [i_TopicVoteUser] where TopicID="&TopicID) MNBoard.Execute("Delete From [i_Bbs"&MNBoard.TB&"] where BbsID="&BbsID&" or ReplyTopicID="&TopicID) MNBoard.Execute("Delete From [i_Appraise] where TopicID="&TopicID) Suc"","成功删除这个主题(包括其回复帖)!","?" End if End Sub Sub DelAll() Dim AllTable,I AllTable=Split(MNBoard.BBStable(0),",") Set Rs=MNBoard.Execute("Select TopicID,SqlTableID From [i_Topic] where IsDel=1") Do while Not Rs.eof MNBoard.Execute("Delete * From [i_Bbs"&Rs(1)&"] where ReplyTopicID="&Rs(0)&"") Rs.movenext Loop Rs.Close For i=0 To uBound(AllTable) MNBoard.Execute("Delete * From [i_Bbs"&AllTable(i)&"] where IsDel=1") Next MNBoard.Execute("Delete From [i_Topic] where IsDel=1") MNBoard.execute("delete * from [i_TopicVote] where not exists (select name from [i_Topic] where [i_TopicVote].TopicID=[i_Topic].TopicId)") MNBoard.execute("delete * from [i_TopicVoteUser] where not exists (select name from [i_Topic] where [i_TopicVoteUser].TopicID=[i_Topic].TopicId)") MNBoard.execute("delete * from [i_Appraise] where not exists (select TopicID from [i_Topic] where [i_Appraise].TopicID=[i_Topic].TopicId)") Suc"","成功清空了回收站!","?" End Sub Sub Giveback Dim BbsID,TopicID,ReplyTopicID,BoardID,Temp BbsID=request.querystring("BbsID") Set Rs=MNBoard.Execute("Select TopicID,ReplyTopicID,BoardID,IsDel From[i_Bbs"&MNBoard.TB&"] where BbsID="&BbsID) IF Rs.eof Then GoBack"","该帖不存在或者已经被永久删除":Exit Sub End IF If Rs(0)=0 And Rs(1)<>0 then MNBoard.Execute("Update [i_Config] Set AllEssayNum=AllEssayNum+1") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+1 Where BoardID="&Rs(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set ReplyNum=ReplyNum+1,IsDel=0 where TopicID="&Rs(1)) MNBoard.Execute("Update [i_Bbs"&MNBoard.TB&"] Set IsDel=0 where TopicID="&Rs(1)&" or BbsID="&BbsID) Else Temp=MNBoard.Execute("Select ReplyNum From[i_Topic] where TopicID="&Rs(0))(0) MNBoard.Execute("Update [i_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&Temp+1&"") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+"&Temp+1&",TopicNum=TopicNum+1 Where BoardID="&Rs(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set IsDel=0 where TopicID="&Rs(0)) MNBoard.Execute("update [i_Bbs"&MNBoard.TB&"] Set IsDel=0 where BbsID="&BbsID) End if Rs.Close Suc"","成功的恢复帖子","?" End Sub Sub Submit() Dim Topic,Reply,Go,Temp,i Topic=Request.form("Topic") Reply=Request.form("Reply") IF Topic="" And Reply="" Then GoBack"","请先选择项目。":Exit Sub Topic=split(Topic,",") Reply=split(Reply,",") Go=Request.form("Go") If Go="删除所选" then For i=0 to ubound(Topic) Temp=split(Topic(I),"|") MNBoard.Execute("Delete From [i_Bbs"&Temp(2)&"] where TopicID="&Temp(0)&" or ReplyTopicID="&Temp(0)) MNBoard.Execute("Delete From [i_Topic] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_TopicVote] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_TopicVoteUser] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_Appraise] where TopicID="&Temp(0)) Next For i=0 to ubound(Reply) Temp=split(Reply(I),"|") MNBoard.Execute("Delete From [i_Bbs"&Temp(3)&"] where BbsID="&Temp(0)) MNBoard.Execute("Delete From [i_Appraise] where BbsID="&Temp(0)&" And TopicID="&Temp(1)) Next Suc"","成功的删除所选的帖子","?" ElseIF Go="还原所选" then Dim TempNum For i=0 to ubound(Topic) Temp=split(Topic(I),"|") TempNum=MNBoard.Execute("Select ReplyNum From[i_Topic] where TopicID="&Temp(0))(0) MNBoard.Execute("Update [i_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&TempNum+1&"") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+"&TempNum+1&",TopicNum=TopicNum+1 Where BoardID="&Temp(1)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set IsDel=0 where TopicID="&Temp(0)) MNBoard.Execute("update [i_Bbs"&Temp(2)&"] Set IsDel=0 where TopicID="&Temp(0)) Next For i=0 to ubound(Reply) Temp=split(Reply(I),"|") Set Rs=MNBoard.Execute("Select Top 1 BbsID From[i_Bbs"&Temp(3)&"] where BbsID="&Temp(0)&" And IsDel=1") If Not Rs.Eof Then MNBoard.Execute("Update [i_Config] Set AllEssayNum=AllEssayNum+1") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+1 Where BoardID="&Temp(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set ReplyNum=ReplyNum+1,IsDel=0 where TopicID="&Temp(1)) MNBoard.Execute("Update [i_Bbs"&Temp(3)&"] Set IsDel=0 where TopicID="&Temp(1)&" or BbsID="&Temp(0)) End If Rs.Close Next Suc"","成功的还原所选的帖子","?" End If End SUB Sub See() Dim BbsID,IUBB,EssayType,TopicID,ReplyTopicID,Arr_Rs,i,Sqlwhere BbsID=Trim(Request.querystring("BbsID")) TopicID=Request.querystring("TopicID") ReplyTopicID=Request.querystring("ReplyTopicID") If ReplyTopicID="" Then Sqlwhere="TopicID="&TopicID&" or ReplyTopicID="&TopicID If TopicID="" or TopicID="0" Then Sqlwhere="BBSID="&BBSID Arr_rs=GetPageInfo("[i_Bbs"&MNBoard.TB&"]","BbsID,Caption,Content,Name,LastTime,BoardID,TopicID,ReplyTopicID,UbbString,Face,IP",Sqlwhere,"TopicID desc","BbsID",10,"Recycle"&BBSID,"?action=See&BBSID="&BBSID&"&TopicID="&TopicID&"&ReplyTopicID="&ReplyTopicID) If IsArray(Arr_Rs) Then Response.Write"
【返回】查看帖子
" Set IUBB=New Cls_IUBB For i = 0 to UBound(Arr_Rs, 2) IUBB.UbbString=Arr_Rs(8,i) ID=Arr_Rs(6,i) If Arr_Rs(6,i)<>0 Then EssayType="主题帖:" TopicID=Arr_Rs(6,i) Response.Write"
" Else EssayType="回复帖:" Response.Write"
" End If Response.Write"
"&EssayType&MNBoard.Fun.HtmlCode(Arr_Rs(1,i))&"
" Response.Write"
" Response.Write"" If Arr_Rs(7,i)=0 Then Response.Write ""&MNBoard.Fun.HtmlCode(Arr_Rs(1,i))&"" Response.Write"
"&IUBB.UBB(Arr_Rs(2,i),1)&"

"&_ "
"&IconD&"永久删除" If i=0 Then Response.Write" 还原帖子" End If Response.Write"
作者:"&IconE&Arr_Rs(3,i)&"  IP:封锁IP "&Arr_Rs(10,i)&"  更新时间:"&Arr_Rs(4,i)&"
" Next Set IUBB=Nothing Response.Write "
"&PageInfo&"
" Else GoBack"","该帖不存在或者已经被永久删除" End If End Sub Function TBList(Num) Dim AllTable,I,Temp AllTable=Split(MNBoard.BBStable(0),",") For i=0 To uBound(AllTable) If Int(AllTable(i))=Int(Num) Then Temp=Temp&"【数据表"&AllTable(i)&"】" Else Temp=Temp&"【数据表"&AllTable(i)&"】" End IF next TBList=Temp End Function %>